   
           
 
            DECLARE	@return_value int,
            @resultsql_1 nvarchar(max)
            EXEC	@return_value =[LANSUNERP]. [dbo].[GenerateTaskList]
            @table_name = N'CustomerType',
            @table_Short = N'GC',
            @tableid = N'*',
            @SysID = N'1',
            @conditions = N'1=2',
            @resultsql_1 = @resultsql_1 OUTPUT
  
 
                USE [LANSUNERPQueryCond]
                GO
                SET ANSI_NULLS ON
                GO
                SET QUOTED_IDENTIFIER ON
                GO
                SET ANSI_PADDING ON
                GO
				 DROP TABLE [dbo].[CustomerTypeQueryCond]
                GO
                CREATE TABLE [dbo].[CustomerTypeQueryCond](
                [QUERYTYPE] [nvarchar](50) NOT NULL,[CONDITIONTYPE] [nvarchar](250) NOT NULL,[REASON1] [nvarchar](100) NULL,[FKEYINSTANCETABLE] [nvarchar](100) NULL,[SYSID] [nvarchar](10) NULL,
[KEYDEFTYPE] [nvarchar](10) NULL,
[GOODSTYPEKEY] [nvarchar](2) NULL,
[GOODSTYPEKEYDEFKEY] [nvarchar](40) NULL,
[GOODSKEY] [nvarchar](50) NULL,
[POSITIONID] [int] NULL,
[GOODSKEYID] [nvarchar](50) NULL,
[CUSTOMERTYPEKEY] [nvarchar](50) NULL,
[CUSTOMERTYPEID] [nvarchar](50) NULL,
[LONGDES] [nvarchar](250) NULL,
[SHORTDES] [nvarchar](100) NULL,
[EXTENEDPROPERTY] [nvarchar](40) NULL,
[LASTPOSITIONID] [int] NULL,
[SUBSTATUS] [nvarchar](max) NULL,
[STATUS] [nvarchar](50) NULL,
[FRSTUSER] [nvarchar](10) NULL,
[FRSTDATE] [datetime] NULL,
[LASTUSER] [nvarchar](10) NULL,
[LASTDATE] [datetime] NULL,
[INSTANCEID] [nvarchar](256) NULL,
[INSTANCEKEY] [nvarchar](256) NULL 
 )  

GO

SET ANSI_PADDING OFF
GO
                            DECLARE	@return_value int,
            @resultsql_1 nvarchar(max)
            EXEC	@return_value = [LANSUNERP].[dbo].[GenerateTaskList]
            @table_name = N'CustomerTypeQueryCond',
            @table_Short = N'GC',
            @tableid = N'*',
            @SysID = N'1',
            @conditions = N'1=2',
            @resultsql_1 = @resultsql_1 OUTPUT
            GO
            INSERT INTO [LANSUNERPQueryCond].[dbo].[CustomerTypeQueryCond]
           ([QUERYTYPE],[CONDITIONTYPE],[SYSID])VALUES ('QueryOnly','IX_CustomerType_SysID','1')
GO 
 
 BEGIN TRANSACTION
 SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
 DROP INDEX IX_CustomerType ON [LANSUNERP].dbo.CustomerType
GO
CREATE NONCLUSTERED INDEX IX_CustomerType ON [LANSUNERP].dbo.CustomerType
 (
SYSID,KEYDEFTYPE,GOODSTYPEKEY,GOODSTYPEKEYDEFKEY,GOODSKEY
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
 DROP INDEX IX_CustomerType_Key ON [LANSUNERP].dbo.CustomerType
GO
CREATE NONCLUSTERED INDEX IX_CustomerType_Key ON [LANSUNERP].dbo.CustomerType
 (
SYSID,KEYDEFTYPE,GOODSTYPEKEY,GOODSTYPEKEYDEFKEY,GOODSKEY
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
 DROP INDEX IX_CustomerType_LikeAny ON [LANSUNERP].dbo.CustomerType
GO
CREATE NONCLUSTERED INDEX IX_CustomerType_LikeAny ON [LANSUNERP].dbo.CustomerType
 (
SYSID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
 DROP INDEX IX_CustomerType_SysID ON [LANSUNERP].dbo.CustomerType
GO
CREATE NONCLUSTERED INDEX IX_CustomerType_SysID ON [LANSUNERP].dbo.CustomerType
 (
SYSID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
 DROP INDEX IX_GoodsType ON [LANSUNERP].dbo.CustomerType
GO
CREATE NONCLUSTERED INDEX IX_GoodsType ON [LANSUNERP].dbo.CustomerType
 (
SYSID,GOODSTYPEKEY
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
 DROP INDEX TX_CustomerType ON [LANSUNERP].dbo.CustomerType
GO
CREATE NONCLUSTERED INDEX TX_CustomerType ON [LANSUNERP].dbo.CustomerType
 (
SYSID,KEYDEFTYPE,GOODSTYPEKEY,GOODSTYPEKEYDEFKEY,GOODSKEY
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [LANSUNERP].dbo.CustomerType  SET (LOCK_ESCALATION = TABLE)
GO
COMMIT


  

